package com.syedu.day07;

import java.time.LocalDate;

public class TestEmployee {
    public static void main(String[] args) {
        //创建三个不同的员工对象
        Employee e1 = new Employee("BB",21,LocalDate.of(2002, 12, 12),10000.0);
        Employee e2 = new Employee("AA",22,LocalDate.of(2012, 8, 15),12000.0);
        Employee e3 = new Employee("CC",25,LocalDate.of(2008, 5, 2),7500.0);

        //把员工添加到数组中
        Employee[] employees = {e1, e2, e3};

        //遍历数组
        for (Employee e : employees) {
            System.out.println(e.getName() + "," + e.getAge() + "," + e.getHireDate() + "," + e.getSalary());
            e.work();
        }
    }
}